package cn.xiyun.xiyuncc.searchFallback;

import cn.xiyun.xiyuncc.dto.CourseSearchDto;
import cn.xiyun.xiyuncc.feignClient.SearchFeignClient;
import cn.xiyun.xiyuncc.result.JSONResult;
import feign.hystrix.FallbackFactory;

public class SearchFallbackFactory implements FallbackFactory<SearchFeignClient> {
    @Override
    public SearchFeignClient create(Throwable cause) {
        return new SearchFeignClient() {
            @Override
            public JSONResult courseSearchSave(CourseSearchDto courseSearchDto) {
                return JSONResult.error("全文检索服务异常");
            }

            @Override
            public JSONResult courseSearchDelete(Long id) {
                return JSONResult.error("全文检索服务异常");
            }
        };
    }
}
